home *** CD-ROM | disk | FTP | other *** search
/ The Netherlands - A Compact World / The Netherlands.iso / chapters / 7.1.2.dxr / 00019_scroll_txt.ls < prev    next >
Encoding:
Text File  |  2004-06-10  |  779 b   |  46 lines

  1. property spriteNum, pScroll, pMousev, pSpritev, pMin, pMax, pState
  2.  
  3. on beginSprite me
  4.   pState = 1
  5.   pMin = sprite(spriteNum).locV
  6.   pMax = the stageBottom - the stageTop - pMin - sprite(spriteNum).member.height
  7.   pSpritev = sprite(spriteNum).locV
  8.   pScroll = 0
  9.   add(the actorList, me)
  10. end
  11.  
  12. on endSprite me
  13.   deleteOne(the actorList, me)
  14.   cursor(-1)
  15. end
  16.  
  17. on mouseDown
  18.   pSpritev = sprite(spriteNum).locV
  19.   pMousev = the mouseV
  20.   pScroll = 1
  21. end
  22.  
  23. on mouseUp me
  24.   pScroll = 0
  25. end
  26.  
  27. on mouseUpOutSide me
  28.   pScroll = 0
  29. end
  30.  
  31. on changestate state
  32. end
  33.  
  34. on stepFrame me
  35.   if pScroll then
  36.     pos = (2 * (the mouseV - pMousev)) + pSpritev
  37.     if pos < pMax then
  38.       pos = pMax
  39.     end if
  40.     if pos > pMin then
  41.       pos = pMin
  42.     end if
  43.     sprite(spriteNum).locV = pos
  44.   end if
  45. end
  46.